\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage[english]{babel}
\usepackage{xcolor}
\usepackage{array}
\usepackage{subfig}

\makeatletter
\renewcommand\thetable{R\@arabic\c@table}
\renewcommand\thefigure{R\@arabic\c@figure}
\makeatother

\graphicspath{{img_reponse_aux_lecteurs/}}
\def\ligne#1{\leaders\hrule height #1\linethickness \hfill}

\newcolumntype{C}[1]{>{\centering}m{#1}}

\newcommand{\Q}{
	\color{black}%
	\rule[1ex]{.9\textwidth}{0.1mm}\\
}
\newcommand{\R}{

	\color{blue}%

}

\title{Reply to the reviewers}
\author{}
\date{}

\begin{document}
\maketitle

\R%-------------------------------------------------------------------------------
%[Fred]
With this new submission, corrections were made according to the reviewers suggestions and the discussion and conclusion sections were entirely rewrote.
The comparison of the algorithm to manual measurements was slightly improved (in the previous version, the comparison was not correct when the length of the measured knot was higher than the length given by the algorithm). Moreover, two knots were removed from the data set because there were measured twice and replaced with three other knots. In consequence, the number of knots is now 125 and the errors and biases data are very slightly modified in the new manuscript.\\

Our replies to the reviewer remarks and questions are presented in blue color hereafter:

\bigskip

\Q%###############################################################################
\textbf{Reviewer \#1}: This is an interesting paper presenting new aspects on an analysis approach for knot quantification in fresh softwood logs and well worth publication. Before publication a number of amendments would round up the presentation. See comments below. 

General comment: 
The presented algorithm works as an consecutive analysis procedure following a manual processing of CT images (marking of knots in the CT images) and subsequent extraction of regions of interest, which makes a difference to the approaches described by several authors in earlier publications on automated knot detection and segmentation. The manual preprocessing of the raw CT images avoids misclassifications of knots or other objects in the stem as knots and the precision of the subsequent procedure is increased. This fact should also be discussed. 
\R%-------------------------------------------------------------------------------

%[Fred]
The discussion section was completely redesigned based on the suggestions of both reviewers.
Nevertheless, we did not follow reviewer \#1 about this specific point: indeed we do not think that the extraction of regions of interest makes a difference for comparing the accuracy of measurements (knot diameter and trajectory) to previous publications. Actually, when comparing to references, all the authors have to remove misclassified objects since they do not correspond to any measurement.

\Q%###############################################################################
Also describe in a few words the precision/ potential deviation to knot dimension measured on real samples. For both potential applications of the CT technology described in the introduction (forest growth, industrial applications in wood processing industry) the reference system is still absolute knot dimensions measured on real knots (e.i. see application of grading standards of roundwood and sawn timber in the industry). To both points see Introduction, paragraph 3 on Aguilera et al. 2012. 
\R%-------------------------------------------------------------------------------

%[Fleur]
We do not fully agree with the comment about the comparison with real knots. The knot limit based on wood density variations is at least as much important, especially regarding wood quality, as the knot limit based on wood color variations. Color is rather linked to aesthetic aspects whereas density is rather linked to wood mechanical properties. Yes, the validation was applied on CT-images because, as it is now explained in the Discussion section, it is in our eyes the correct way to validate the algorithm. The correspondence between wood color and wood density variations is another problem, very interesting but totally independent from the algorithm performance. The two analyses have to be distinguished: 1) Comparison between automated and manual measurements on CT-images; 2) Comparison between manual measurements on CT-images and on color images (i.e. correspondence between density and color variations).

\Q%###############################################################################
Please be precise when speaking about the moisture status of material tested: in fresh (wet) logs heartwood is not dry but also contains a lot of water, however less than sapwood (see Johan Skog 2009, 2013). Furthermore, Johansson et al (2013) and Breinig et al (2012) worked both on fresh logs; the latter also performed reference measurements based on real knot dimension using a similar tangential approach on discs and cross-sectional CT slices, however not as stacked tangential slices. 
\R%-------------------------------------------------------------------------------
%[Fred]
A comment about density and moisture content of sapwood and heartwood at fresh state was added to the first paragraph of the introduction.

\Q%###############################################################################
Silver fir (one of the 5 tested species) is very prone to develop wet corewood which makes feature extraction in the heartwood impossible. This defect narrows the application of any automated detection and segmentation algorithm, and the likelihood of wet corewood should be stated/discussed. 
\R%-------------------------------------------------------------------------------
%[Fleur]
A discussion was added on this point.

\Q%###############################################################################
Results, discussion and conclusion require strengthening in the argumentation. 
\R%-------------------------------------------------------------------------------
%[Fleur]
The whole manuscript was revised and improved according to the reviewer comments.


\Q%###############################################################################
Introduction: 
Paragraph 1: very general introduction to the topic, the reader will not understand why this investigation is important unless he is already involved in the same field of research. The focus of this paper is the algorithm as such, the application of the procedure and its relevance to the industry is not discussed anywhere. To stick to the focus of this paper start with paragraph 2 of the introduction. 
\R%-------------------------------------------------------------------------------
%[Fred]
Done. Paragraph 1 was removed.

\Q%###############################################################################
Paragraph 2: The problem of feature detection in fresh (wet) wood (not only knots) is as old as the attempt to use this technology as this is basic physics. Thus it would be logic to give reference to the publications which mention these problems the first time in the 1990's and the impact on the analysis.
\R%-------------------------------------------------------------------------------
%[Fred]
Done. The pioneer works of Taylor et al. 1984, Funt 1985 and Funt and Bryant 1987 are now cited (line 15 of the new manuscript).

\Q%###############################################################################
The authors should mention the level of density difference due to different water content in heartwood and sapwood, i.e. that sapwood has a much higher water content than fresh heartwood. 
\R%-------------------------------------------------------------------------------
Done lines 24-26.

\Q%###############################################################################
Feature (knot ) detection works for softwoods fine in fresh (wet) heartwood, sapwood was always the problem. However, databases in Sweden and Germany exist on several hundred of softwood logs scanned in fresh condition as this is the typical condition in an industrial CT application. 
Describe the approaches of other authors in an adequate way that the reader can follow the authors' appraisal to use an earlier idea or take a different approach. Aguilera et al. 2012, what is interesting? Breinig et al 2012, algorithm of automated knot detection and dimension measurement appears to work reasonable in fresh heartwood, though not in sapwood; Johansson et al (2013) work on CT images which will be provided by industrial scanning, so "low quality" might be a relative measure. 
\R%-------------------------------------------------------------------------------
%[Fleur]
This part was modified and more details are now given.

\Q%###############################################################################
"Sampling": 
delete ", the most important softwood sawmill in France". This is irrelevant information. 
\R%-------------------------------------------------------------------------------
Done.

\Q%###############################################################################
The material should be described more precisely. As it comes from a sawmill, how fresh was the material? Were the logs stored for a long time, were the logs irrigated in water storage. This would change the water content, and moisture distribution in the cross section. 
\R%-------------------------------------------------------------------------------
%[Fred]
The information was added line 103. The logs were stored during 1 to 5 months under water sprinkling on the log yard before scanning. The moisture content of the logs should be representative of the usual conditions in this sawmill.

\Q%###############################################################################
Describe the logs in terms of diameter, heartwood diameter and sapwood width. It would be interesting to know how many of the tangential slices per measured knot were located in the heartwood and how many were located in the sapwood zone. 
\R%-------------------------------------------------------------------------------
%[Fred]
A table describing log diameters, heartwood diameters and sapwood width is presented in Table \ref{tableBillons}. In the manuscript, we rather decided to present graphically one slice per sampled log (new Fig. 1). The ranges of log diameters and sapwood ratios are now given lines 101-102.

For computing the number of slices in sapwood and heartwood and comparing the accuracy of the algorithm, we checked the stack of images of each knot to decide where was the heartwood/sapwood boundary. It was found that the sapwood ratio (i.e., the number of slices attributed to sapwood divided by the total number of slices) was 47\% in total. It was ranging from 8 to 76\% depending on the knot. Only 4 knots had less than 20\% of sapwood.
A comment was added about these measurements lines 167-170.

\begin{table}[h!]
	\footnotesize
	\centering
	\begin{tabular}{l C{1cm} C{1cm} C{1cm} C{1cm} C{1cm} C{1cm}}
	\hline
	log  name & length (m) & diameter (cm) & heartwood diameter (cm) & sapwood width (cm) 
	& sapwood ratio (\% of radius) & number of measured knots\tabularnewline
	\hline
	DOU-1-B & 1.6 & 26.3 & 19.1 & 3.6 & 27 & 9\tabularnewline
	DOU-1-T & 1.6 & 16.55 & 9.15 & 3.7 & 45 & 8\tabularnewline
	DOU-2-B & 1.5 & 27.7 & 19.1 & 4.3 & 31 & 2\tabularnewline
	DOU-3-T & 1.6 & 22.3 & 16.9 & 2.7 & 24 & 6\tabularnewline
	FIR-1-B & 1.5 & 15.65 & 8.65 & 3.5 & 45 & 16\tabularnewline
	FIR-1-T & 1.5 & 12.1 & 5.7 & 3.2 & 53 & 8\tabularnewline
	FIR-3-T & 1.6 & 18.45 & 7.85 & 5.3 & 57 & 7\tabularnewline
	LAR-2-B & 1.6 & 25.35 & 19.15 & 3.1 & 24 & 4\tabularnewline
	LAR-2-T & 1.5 & 16.9 & 11.7 & 2.6 & 31 & 13\tabularnewline
	LAR-4-T & 1.5 & 21.2 & 14 & 3.6 & 34 & 9\tabularnewline
	PIN-1-B & 1.6 & 27.15 & 16.95 & 5.1 & 38 & 1\tabularnewline
	PIN-1-T & 1.5 & 16.9 & 8.5 & 4.2 & 50 & 12\tabularnewline
	PIN-2-T & 1.5 & 20.2 & 7.6 & 6.3 & 62 & 7\tabularnewline
	SPR-1-T & 1.5 & 24.05 & 13.45 & 5.3 & 44 & 10\tabularnewline
	SPR-2-T & 1.5 & 28.25 & 18.85 & 4.7 & 33 & 9\tabularnewline
	SPR-3-T & 1.5 & 21.65 & 10.65 & 5.5 & 51 & 6\tabularnewline

	\end{tabular}
	\caption{Description of the log sampling. 
	The three first characters of the log name identifies the species:
	DOU = Douglas fir, FIR = silver fir, LAR = European larch, PIN = Scots pine, SPR = Norway spruce.
	}
	\label{tableBillons}
\end{table}


\Q%###############################################################################
What size of log had a 5.6mm knot present in sapwood, was this a primary knot originating at the stem pith? 
\R%-------------------------------------------------------------------------------
%[Fred]
Yes, this 5.6 mm knot was of primary origin. The log in which it was measured was a 26 cm diameter spruce log (Fig. \ref{fig_spr1t}). The second and third smallest knots belonged to a fir (5.7 mm for a 16 cm diameter log) and a Douglas fir (6.0 mm for a 18 cm diameter log) logs, respectively.

\begin{figure}[h!]
	\centering
	\includegraphics[width=9cm]{SPR-1-T}
	\caption{Log SPR-1-T with the smallest measured knot.}
	\label{fig_spr1t}
\end{figure}

\Q%###############################################################################
Define knot size: what is "small", what is "large". Density distribution will be different for the different knot dimensions. 
\R%-------------------------------------------------------------------------------
%[Fleur]
The sentence was modified.

\Q%###############################################################################
What was the status of the knots at the different positions of the tangential slices: ingrown/sound, black knot, rotten knot; this will have an effect on the grey value profile of the polar transformations. 
\R%-------------------------------------------------------------------------------
%[Fred]
The sample did not include any rotten knot. The limit between the sound part and the dead part of the knots was not measured since it cannot be easily determined on the CT images (see also our reply to reviewer \#2, issue I).

\Q%###############################################################################
"Manual detection and measurement of knot" 
Did you test the accuracy of the knot pith location on large knots where the knot pith can be visible on the CT images. The small deviations in repeated manual knot measurement undertaken by the same person can still mean a systematic error. 
\R%-------------------------------------------------------------------------------
%[Fred]
This accuracy was not tested since the knot pith location was not measured but assumed to correspond to the geometric centre. Apparently, this assumption is correct along the tangential axis but probably less along the longitudinal axis (in relation with compression wood). This point could explain that we observed biggest errors vertically than horizontally.

\Q%###############################################################################
"Automated knot segmentation algorithm" 
Paragraph 1, line 8-9: 
How do you identify the plane which you use for the manual reference measurements at 10\% steps as described in statistical validation? 
\R%-------------------------------------------------------------------------------
%[Fred]
For each measurement given by the algorithm we computed the relative position within the knot (from 0 near the log pith to 1 near the log bark). A linear interpolation was used to compute the values at each 10\% of the total knot length for comparing with manual measurements (see also new Fig. 7).

\Q%###############################################################################
Knot diameter or knot radius? What is the original output of the algorithm, that is radius? Be precise with the reported diameter variable  ? 
\R%-------------------------------------------------------------------------------
%[Fleur]
The algorithm provides knot radii. This is mentioned line 155 of the new version of the manuscript. However, for the validation step, radii were converted to diameters since diameter is a more classical variable to characterize knot size. We have modified the text for a greater clarity (lines 160-161).

\Q%###############################################################################
Description of segmentation algorithm: 
Step2: Knot radius measurement 
The Merkel's ratio should be stated and discussed in the discussion section as you do not apply the ratio in your algorithm. There, the reference should be cited directly as Merkel (1967). 
\R%-------------------------------------------------------------------------------
Done.

\Q%###############################################################################
Sub-step: Polar elliptic transform centered on the knot pith 
Suggest: "transformation" instead of "transform" 
\R%-------------------------------------------------------------------------------
Done.

\Q%###############################################################################
Here it is assumed that the tangential slices are vertically oriented and perpendicular to the transversal plane of the stem (cross section)? 
\R%-------------------------------------------------------------------------------
%[Fred]
Yes. The sentence was modified to make it more clear.

\Q%###############################################################################
Step 3: Post-processing 
Describe this in more detail. What do you mean by "biggest errors are corrected"? Line 242 says so: removing and interpolation in the gaps. 
\R%-------------------------------------------------------------------------------
%[Fred]
The sentence was rewritten (line 242): "outlier radii are identified and replaced by linear interpolation".

\Q%###############################################################################

Why was the interval defined by 1.5xIQR too large, but 1.0xIQR ok? Why not 1.1 IQR? A sensitivity analysis might help. 
\R%-------------------------------------------------------------------------------
%[Fred]
We did not perform a real sensitivity analysis but several values of this parameter were tested on a sub-sample of problematic knots and the value of 1 was chosen by trial and error method. In the new version we added this parameter (named k) to the list of parameters of the algorithm. As it is now mentioned in the conclusion, a sensitivity analysis concerning all the parameters of the algorithm is in project.

\Q%###############################################################################
What positions of knots caused the majority of outliers, close to the pith or close to the bark in the sapwood? What are the reasons for this? Black knots, rotten knots, ingrown bark? 
\R%-------------------------------------------------------------------------------
%[Fred]
Most of them occur near the log pith (due to the small size of the knot), near the heartwood/sapwood transition (like in new Fig. 7) and near the bark (Fig. \ref{barplotOutliersRepartition}). A paragraph was added in the Results section.

\begin{figure}[h!]
	\centering
	\includegraphics[width=7cm]{barplotOutliersRepartition}
	\caption{Density of probability of outliers vs relative position along the knot (0 = pith, 100 = bark). Outliers from positions 90-100 \% were not computed.}
	\label{barplotOutliersRepartition}
\end{figure}

\Q%###############################################################################
Section 3.3.3 Extrapolation of the knot radius at the bark side 
you talk about difficulties of segmentation close to the bark. 10\% of the knot length are ignored and extrapolated due to outliers or inconsistent values. How many tangential slices in the analysis are located in the sapwood? 
Why you assume constant radius for the extrapolation? Give an explanation or better a reference on knot shape development to strengthen your argumentation. 
\R%-------------------------------------------------------------------------------
%[Fred]
As mentioned above, 47\% of the slices were located in sapwood.
The choice of a constant radius is not based on any assumption on shape development: we assume a constant value because we are not confident in the values computed at the end of the knot.

We agree that this extrapolation is not satisfying. These difficulties of segmentation occur mainly for some knots which length is slightly lower than the log radius (Fig. \ref{fin_noeuds}). It was not clearly explained so far that the algorithm is not able to detect the knot ends. In the current implementation, the length is supposed to be equal to the radius and we selected knots ending near the bark (this point is now stated in the material and method section, lines 114-115). A better implementation, which is in progress, will be able to detect the knot end and to better manage pruned or incomplete knots (this point is now discussed lines 487-495).

\begin{figure}[h!]
	\centering
	\includegraphics[width=3.5cm]{fin_noeud_DOU-1-B-130-1166}
	\includegraphics[width=3.5cm]{fin_noeud_LAR-2-B-318-235}
	\includegraphics[width=3.5cm]{fin_noeud_PIN-1-T-199-1003}
	\caption{Examples of knots ending before the bark.}
	\label{fin_noeuds}
\end{figure}

\Q%###############################################################################
Fig. 3: "profile of Hounsfield units (HU)" as given on y-axis of graph instead of "profile of gray level values. Which tangential slices are presented, could be a good idea to show the respective slices in Figure 1 and Fig 2 
\R%-------------------------------------------------------------------------------
%[Fleur]
The y-axis label of ex-Fig. 3 (new Fig. 5) was corrected. The figure captions were modified in order to precise the correspondence of knots between the different figures. 

\Q%###############################################################################
Fig 4: any explanation what the "low density" band around the knot is? Maybe the knot is a dead knot with a clear edge to the stem wood? 
\R%-------------------------------------------------------------------------------
%[Fleur]
A paragraph about this interesting question was added in the Discussion.
\Q%###############################################################################

Fig. 5: hard to read, here authors present knot radius (knot diameter otherwise throughout the paper). It would be interesting to know the number of consecutive tangential slices to represent the knot of what length from pith to bark(app. 150 slices over what length). It would it be possible to derive the sound/dead knot border from such a profile? 
\R%-------------------------------------------------------------------------------
%[Fred]
The printing quality of the figures was improved. 
%[Fleur]
Knot diameters (instead of knot radii) are now presented in the new Fig. 7 (ex-Fig. 5).
No, it is not possible to derive accurately the sound/dead knot border from such a profile because of the decline period (about 8-10 years) during which the knot does not grow anymore but is still sound. A paragraph was added in the new version of the Discussion on this point.   

\Q%############################################################################### 
Results/discussion:
Figures 6,7,8: for clarity present the size of the knot, not only dimension class, small or big. 
\R%-------------------------------------------------------------------------------
%[JR]
Done.

\Q%##############################################################################
The reference for the pith position is not precisely obtained from an accurate marking of the exact pith position but calculated from the marking of the knot/stemwood boundary and a derived "center" of the knot. 
\R%-------------------------------------------------------------------------------
%[Fleur]
Yes, it is true and it is explained in the manuscript at lines 134-137. 

\Q%###############################################################################
As the paper's focus is much on the problematic segmentation of knots in the sapwood zone, a comparison should be presented between measurement accuracy of the same approach for tangential slices in the heartwood zone and the one from the sapwood zone. 
\R%-------------------------------------------------------------------------------
%[Fred]
The table 1 now shows the results for heartwood and sapwood. Since most of the errors occur near the pith, the results are slightly better in sapwood than in heartwood.

\Q%###############################################################################
It is difficult to judge, how good the positioning really is. It depends strongly on the resolution of the CT images, which is very high in this investigation. The "problem" of resolution applies to the accuracy of the knot diameter as well. This is an important technical detail for this investigation and should be discussed in detail in the discussion section. 
\R%-------------------------------------------------------------------------------
%[Fleur]
A discussion about the problem of image resolution was added in the new Discussion section.

\Q%###############################################################################
Last paragraph of results section "accuracy of maximum diameter of each knot": what is the objective to present this data? It is not further discussed later, better skip this paragraph. 
\R%-------------------------------------------------------------------------------
%[Fleur]
We have decided to keep this paragraph because in our eyes, it is important to give also the results in term of maximum diameter along knots since it is a reference measurement when we speak about wood quality and knot size. This also enables comparisons with other results from the literature, also given in term of maximum diameter. The RMSE given is the Discussion was corrected because it was not maximum diameter in the old version of the manuscript.

\Q%###############################################################################
Discussion: 
Overall the discussion is still a bit weak and scratch on the surface. A bit more reflection on the advantage and the disadvantage of the presented algorithm. 
\R%-------------------------------------------------------------------------------
%[Fleur]
The discussion was entirely revised in the new version of the manuscript taking into account all the reviewer comments.

\Q%###############################################################################
Answers the reader would like to get: how can shortcomings like the perturbations of segmentation by other objects be solved. Is it possible to merge this automated step of CT analysis with an algorithm of automated knot detection and avoid manual knot marking. 
\R%-------------------------------------------------------------------------------
%[Fleur]
Yes, it is explained lines 81-82 of the manuscript that our segmentation algorithm can be used behind an existing knot detection algorithm. Such an algorithm already exists (we give references in the conclusion) and enables to isolate individual knots in sectors with a very good accuracy.  

\Q%###############################################################################
How fast is this procedure, is it fast enough for industrial application online, or is it a slower, but high precision analysis tool for research? 
\R%-------------------------------------------------------------------------------
%[Fred]
The present version of the algorithm was implemented as an ImageJ plug-in programmed in Java language without any optimisation concern. We did not measure the processing time but it is certainly not compatible with industrial applications. Nevertheless, optimising the algorithm would be easy by parallelising the processing of each knot.

\Q%###############################################################################
Amend the discussion on measurement accuracy accordingly that the full picture of approaches is clear to the reader (Breinig et al: automated knot detection in fresh heartwood, reference are real measurements on wood; Longuetaud et al: dry logs, reference is manual marking of knot diameter on CT slices, Johansson et al: automated knot detection and measurements on fresh logs on industrial CT images; reference manual marking of knots on high resolution CT images. Also double-check with the resolution of the images. 
\R%-------------------------------------------------------------------------------
%[Fleur]
Done in the new version of the Discussion.

\Q%###############################################################################
Can't follow the argument that the results of Johansson et al cannot be discussed and "comparison is not relevant". The resolution of the images is one of the fundamental problems to extract the correct knot dimension from CT images, and must be discussed. There is a difference between 0.34 mm pixel size and 1mm. 
\R%-------------------------------------------------------------------------------
%[Fred]
The comparison with Johansson et al. was strengthened by fitting their knot model ($\phi = A + B \cdot r ^ {\frac{1}{4}}$) on our data for enabling direct comparison (lines 379-388, Fig. \ref{diams_mod_manu-auto}).
%Since they do not mention the resolution of their images we cannot be more precise.

We did not test the algorithm on lower resolution images and this is planned for the next future. We assume that the method should work with images of lower transverse resolution (as long as the low density contour of the knots are visible) but would probably be much more sensitive to lower longitudinal resolution. A discussion about this point was added to the new manuscript (lines 454-477).

\begin{figure}[h!]
	\centering
	\includegraphics[width=7cm]{diams_mod_manu-auto}
	\caption{Comparison between automatic and manual measurements of local diameters after fitting knot model of  Johansson et al. 2013.}
	\label{diams_mod_manu-auto}
\end{figure}

\Q%###############################################################################
Overall RMSE appear in a similar range for this investigation, Longuetaud et al and Breinig et al., however higher for Johansson et al. when considering Norway spruce and Scots pine (Tab. 1). 
The authors do not discuss the deviation of accuracy in knot diameter measurement for the 5 species sperately. What is the reason for this? Are there differences in knotwood/stemwood structure in these 5 species? 
\R%-------------------------------------------------------------------------------
%[Fleur]
The difference between species are discussed in the new version of the manuscript.

\Q%###############################################################################
Choice of parameters: 
This section needs further development; all settings must be presented in the relevant sections where the parameters apply in the algorithm and the steps and sub-steps. In the discussion section the reader expects a discussion about the sensitivity of the procedure to the parameter settings. 
\R%-------------------------------------------------------------------------------
As it was explained the parameters were set empirically and no sensitivity analysis was performed so far. A paragraph was added in the conclusion (lines 541-543) to explain that such analysis will be performed when the new software implementation will allow to test the algorithm more easily.

We agree that the settings have to be presented together with the algorithm description but we prefer not to disperse it in each relevant section. The settings are now given lines 279-296, at the end of the description of the algorithm.

\Q%###############################################################################
Conclusions: 
This section also requires polishing and strengthening. There are no real conclusions drawn from the results presented. 
\R%-------------------------------------------------------------------------------
%[Fleur]
The conclusion was entirely revised.

\Q%###############################################################################
"The algorithm works regardless to the moisture content ……". These data has not been presented, the material was described as wet, but no variation of moisture content has been reported. Maybe the authors mean the differences between sapwood and heartwood, but this should be stated more clearly. A comparison on the accuracy in these two different cross-sectional zones of a stem however are not presented in the current stage of the paper. 
\R%-------------------------------------------------------------------------------
%[Fred]
The sentence was modified since we did not measure the moisture content. As it is mentioned in the material and method section (lines 103-109) the logs were stored during 1 to 5 months on the log yard which means that the water content was probably variable. The new Fig. 1 shows that some logs presented discontinuous regions of high density wood in the periphery. The conclusion (lines 534-536) now emphasizes that the algorithm works as well for various configurations of sapwood aspect.

A comparison of the accuracies obtained in heartwood and sapwood, respectively, was added (Table 1).

\Q%###############################################################################
"..TEKA robust enough to process a large range of configurations." This is very general and what configurations are meant? What means a large range? 
\R%-------------------------------------------------------------------------------
This sentence was removed.

\Q%###############################################################################
"The results ……..can be considered as very accurate……………………..". This appears true for the comparison within the given system that all measurements were carried out on the same CT images; however the representation of the reality in the CT images can be reduced due to technical limitations of the CT scanner used. So the accuracy of the algorithm in comparison to a ground truth (physical size and position of knots) (which might be very difficult to measure) is not touched. For the conclusions it would be helpful when the authors could develop an idea to tackle this problem. 
\R%-------------------------------------------------------------------------------
%[Fleur]
We have already discussed this problem above. The definition of what is "ground truth" is not clear. In this paper, the objective was to compare an algorithm to corresponding manual measurements on the same CT images. The comparison to knot measurements done on real boards or cross-sections is very interesting but cannot be analyzed in this paper. An analysis about the comparison between wood color and density variations could be performed later based on manual measurements only.

\bigskip

\Q%###############################################################################
\textbf{Reviewer \#2}: ---------------- 
GENERAL COMMENTS 
---------------- \\
The topic of the article is very important. As the authors correctly point out, the question how to detect knots in CT images of moist sapwood is very 
important and has so far not been satisfactory answered. Therefore, this article which specifically adresses this issue, is a very important contribution 
to the field. 

Overall, the paper is well written and provide valuable new research results. The method is inventive and takes a new approach to the problem, and the 
results seem promising. I recommend the paper for publication, but before publication, there are some issues that need to be addressed. My biggest 
concern are issues I and II, as they could have an influence on the validity of the results. If these issues are handled properly in the paper, the 
result will be a very strong publication. 

I. Sound knots/dead knots 
The article does not at all mention the topic of sound and dead knots. First of all, there is no mention of the knot types of the sample knots that are 
being evaluated in this paper. When I read between the lines, however, it seems that there may be bias towards sound knots. (It says that all sampled 
knots are present in sapwood, does this mean that all knots that extend all the way to the surface?) If only sound knots are being considered, it is 
important that this is clearly stated. If also dead knots are considered, the paper should say so, and especially tell if the method works also for dead 
knots (see issue II). 
\R%-------------------------------------------------------------------------------
%[Fleur]
We are not able to say which part of a knot is sound and which part is dead. As a consequence, our sample probably included both sound and dead knots and our algorithm works on both types of knots. A discussion was added in the new version of the article about this point.
%[Fleur] Comme ils commencent à nous faire chier il faut leur dire qu'il n'y a quadiement rien de publié sur le sujet de la détection auto de la limite et que la ref des suédois parle de 12 noeuds seulement et n'est pas convaincante

\Q%###############################################################################
II. How general is the proposed method 
Second issue is that the approach is based on looking for a high density area inside of the knot, surrounded by a low density area outside the knot (algorithm step 3.2.2 and figure 3). This seems to work for the (small) sample of evaluation knots presented in the paper. But no reference is given, stating that there is always such a density pattern. Because the algorithm relies heavily on this density pattern it would be good with a reference or some other argument why this pattern can be expected to be general. This is also related to issue I, because sound and dead knots could appear differently in the CT images. 
My question is based on experience from personal research (on lower resolution images) where I have noticed other types of density patterns (b)-(e) for knots in sapwood than the one used in this paper (a). The patterns below are described from knot pith, just as in Figure 3. 
(a) low density, high density, low density, background [covered by this paper] 
(b) high density, low density, background 
(c) low density, high density, background 
(d) high density, background 
(e) low density, background 
Low and high density refer to values lower or higher than the background. 

The above mentioned knot density patterns were observed in low resolution images. It is possible that in high resolution images most of the knots tend to go towards type (a), as being assumed in this paper. For knot types (b) and (d), rA will go to zero and for knot types (c) and (d), rB will become very big. This could affect the algorithm results, but how? Knot type (e) cannot be expected to work at all. Because these things affect how general the use of the algorithm is, it should be treated in some way. 
\R%-------------------------------------------------------------------------------
%[Fleur]
A new Figure (Fig. 2) was added showing for each species examples of transversal, radial and tangential cross-sections. The low density band around the knot is visible in tangential images for all the species and the algorithm works well for most of our knots whichever the species. However, it is possible that with lower resolution images the low density areas would become less visible. A discussion was added about the resolution of images.

\Q%###############################################################################
III. The discussion need to be extended 
Right now the discussion is very weak, it just compares the RMSE values to other similar papers. The discussion should instead focus on the strenghts 
and weaknesses of the proposed method and the feasabiltiy of the method in different possible applications. How useful will it be in practice? The 
discussion need to cover the very important resolution question. This method seems to require very high resolution images (voxel size around 1 mm3). 
What will happen if the lentghwise slice distance is 10-15 mm (which is normal for an industrial application)? Right now, the introduction says that 
the research question is of both scientific and industrial importance, but the results are never being discussed in an industrial context, neither in 
terms of resolution requirements nor in terms of calculation speed. Issues I and II above are well worth discussing in the disucssion. Plus questions 
like roboustness, for instance, what will happen if the method is applied to an image without a knot? (the paper says that knots must be previously 
detected using another algorithm, but this is still an important question from a roboustness point of view) 
\R%-------------------------------------------------------------------------------
%[Fleur] COMPLETER quand la discussion sera faite. Dire ce qui a été ajouté.
The discussion section was entirely rewritten following the remarks of both reviewers.

\Q%###############################################################################
----------------------------- 
SPECIFIC COMMENTS ON THE TEXT 
----------------------------- \\
9. Abstract line 2 mentions industry, the industrial applications of the research need to be discussed in the discussion 
\R%-------------------------------------------------------------------------------
%[Fred] Faut-il rajouter qq chose pour dire à quoi ça peut servir dans l'industrie ??
A paragraph was added to the discussion section (lines 480-486) about the improvements needed before envisaging potential industrial applications.

\Q%###############################################################################
9. Abstract should include something on the image resolution, voxel size. 
\R%-------------------------------------------------------------------------------
%[Fred]
Done.

\Q%###############################################################################
70. TEKA sounds like an acronym. Please define the meaning of the word. 
\R%-------------------------------------------------------------------------------
%[Fred]
Actually, TEKA is the French pronunciation for the acronym "TK" and this name was chosen in reference to the TKDetection (Toolkit for Knot Detection) software which will implement the algorithm in the future. To our opinion, this history is too complicated to be explained in the paper...

\Q%###############################################################################
77. Here the authors says they dont cover the topic of determining if there is a knot or not in the image. Somewhere in the results/discussion, however, it would be interesting to come back to this topic and discuss what happens if the previous step fails and we look for a knot where there is no not. Is this handled by the post-processing? 
\R%-------------------------------------------------------------------------------
%[Fred]
No, this case is not handled and the algorithm won't work if there is no knot in the image. Actually, it is not even able to detect the end of knot in the case of pruned knots. We tested only knots reaching the bark or ending very close to the bark (see also Fig. \ref{fin_noeuds} and our reply to reviewer \#1). This limitation is now clearly explained in the material and method section and a paragraph about future enhancements was added to the discussion section (lines 478-495).

\Q%###############################################################################
86. The tangential view subimages are in all aspects equivalent to the concentrial view subimages of Grundberg/Grönlund and Johansson. In my opinion, this is not where the novelty lies. The main difference and real novelty in this paper is the segmentation method, as correctly pointed out on line 92. 
\R%-------------------------------------------------------------------------------
%[Fred]
We nevertheless consider the approach as original (the "new" adjective was removed).
The tangential slices and the concentric surfaces have much in common but are not exactly the same: near the pith, the curvature radius makes the shape of the intersection with knots enlarged in the tangential direction. In our case, this deformation would complicate considerably the search for the ellipticity ratio corresponding to the inclination angle. This is may be also the reason for the 20\% shrinking applied by Johansson et al for not overestimating the knot diameters.

\Q%###############################################################################
98. The sample size is very small, only a small number of knots from three-four logs of each specie are considered. 
\R%-------------------------------------------------------------------------------
To our point of view a sample of 125 knots from 5 species with 1250 diameter measurements is not so small compared to other papers: validation results presented by Breinig et al. 2012 concerned 119 measurements from 55 knots, those of Johansson et al. 2013 concerned 127 Scots pine knots and 119 Norway spruce knots and Aguilera et al. 2012 applied their method to only 90 slices.
It is now mentioned in the conclusion that further work will be performed on a larger sampling when an automated tool will be available.

\Q%###############################################################################
106-107. Does this introduce a bias towards sound knots? Do you know anything about the distribution of dead and sound knots? 
\R%-------------------------------------------------------------------------------
%[Fred]
No, we don't know the distribution. See our reply to issue \#1 above.

\Q%###############################################################################
107. Where does the knots end? All at the surface, or do some knots end inside the log? 
\R%-------------------------------------------------------------------------------
We selected knots reaching the bark surface as it is now said lines 114-115. The algorithm cannot manage pruned knots. A paragraph was added to the discussion about this restriction (lines 487-495).

\Q%###############################################################################
112. High resolution images are being used. This should be discussed in the discussion, since industrial images use 10-40 times larger voxels. 
\R%-------------------------------------------------------------------------------
Done lines 454-477.

\Q%###############################################################################
138. R is not a suitable variable name to introduce here since it is also being used in another context in the case of R2 (line 153) 
\R%-------------------------------------------------------------------------------
%[JR]
Done, "R" was replaced by "d".

\Q%###############################################################################
153. The R in R2 should be in italic (also line 277, 283 etc) 
\R%-------------------------------------------------------------------------------
%[JR]
Done.

\Q%###############################################################################
168. Chapter 3.1: what are the image resolution requirements of the PithExtract alogrithm? Any other relevant limitations of this method? 
\R%-------------------------------------------------------------------------------
%[Fred]
The PithExtract algorithm was tested on images with a pixel size up to 1mm (this detail was added line 187). We assume that it should work with lower resolution images since the edges of the knots are visible and concentric. To our knowledge there are not other relevant limitations.

\Q%###############################################################################
192. Here some vital information is missing. What is the resolution of the polar image? deltaTheta=1 degree, deltaRadius = 1 mm??? 
\R%-------------------------------------------------------------------------------
%[Fred]
The resolution was equal to one degree in the vertical direction. In the horizontal direction, the resolution depends on the angular position. It was set equal to the resolution of the tangential slices for the shortest radius. These details were added lines 210-219.

\Q%###############################################################################
197. Gaussian blur seems inappropriate on a polar image because the r and theta coordinates are not equivalent. It would seem more appropriate to do the blur in the carthesian image before transforming it. Does this make a big difference on the final results? 
\R%-------------------------------------------------------------------------------
%[Fred]
There was an error in the description of the algorithm: the blur was actually applied to the cartesian image before the polar transform. The text was corrected (lines 207-209).

\Q%###############################################################################
226. What if many consecutive radii are outliers - how common is this situation? 
\R%-------------------------------------------------------------------------------
%[JR]
Figure \ref{histGoupsizeOutliers} below shows the distribution obtained for the outliers by group of consecutive outliers. It can be observed that the groups of more then 15 consecutive outliers are rather rare (less than 5\%). The example shown by the new Fig. 7 is one of the worst case.

\begin{figure}[h!]
	\centering
	\includegraphics[width=7cm]{histGoupsizeOutliers}
	\caption{Density of distribution of outliers by group size.}
	\label{histGoupsizeOutliers}
\end{figure}

\Q%###############################################################################
234. What degree of polynomial? 
\R%-------------------------------------------------------------------------------
%[Fred]
The reply is probably 2 but this is not clearly stated in the commons.apache.org documentation page. The reference to the polynomial fit was removed.

\Q%###############################################################################
259. It took me a while to catch what you mean. You should consider rephrasing this sentence. 
\R%-------------------------------------------------------------------------------
The sentence was changed (lines 276-278).

\Q%###############################################################################
276. Sometimes pretty large errors in vertical positioning. You could discuss the influence of this error on the following calculations. 
\R%-------------------------------------------------------------------------------
%[Fred]
We may consider that the differences with the manual measurements are not real errors since the reference is not reliable (RMSD between two manual measurements = 5.1 mm, RMSE of the algorithm = 4.2 mm). Anyway, we did not really discuss the influence of this error but a paragraph was added to the discussion (lines 459-477) about the impact of a low longitudinal resolution, to which the errors on vertical position are directly related.

\Q%###############################################################################
346. Not suitable to write "relatively high errors", its better to write "higher errors". In fact, considering the very coarse resolution of the images in Johansson (at least 10 times lower than your resolution), their result of 5 mm RMSE is not so bad. 
\R%-------------------------------------------------------------------------------
%[JR]
Done. See also the discussion about the comparison with Johansson et al. lines 379-388 and our reply to reviewer \# 1 (about Fig. \ref{diams_mod_manu-auto}).

\Q%###############################################################################
356. You have not defined the resolution of the transformed image (see line 192) - by adding that info on line 192 this line would start to make sense. 
\R%-------------------------------------------------------------------------------
%[Fred]
The info was added and the blur was applied to the cartesian image.

\Q%###############################################################################
355-357. You do not mention anywhere the effect of the varying pixel widths in your indata. If I understand you correctly, this actually means that you have been using different filter sizes [in mm] for logs of different sizes. This is worth mentioning somewhere here. 
\R%-------------------------------------------------------------------------------
It is mentioned in the material and method section that pixel size "ranged between 0.36 and 0.81 mm/pixel depending on the log diameter". We did not observe any relation between pixel size and the errors on diameter or pith position.
The information was added lines 360-362.

\Q%###############################################################################
370. See comment from line 86. The real novelty is not in the tangential approach, but in the segmentation method. 
\R%-------------------------------------------------------------------------------
%[JR]
The sentence was modified.

\Q%###############################################################################
Figure legends: 
As a general remark, think about that the figure legends should be understandable "stand alone". (this comment goes for most of the figure legends) 
\R%-------------------------------------------------------------------------------
%[Fred]
All the figure legends were improved and rewritten.

\Q%###############################################################################
Fig 2: change the legend, what interest are you talking about? Rather mention something about the knot begin visible to the left in the transformed image. Also mention resolution of the polar transform. 
\R%-------------------------------------------------------------------------------
%[JR]
Done.

\Q%###############################################################################
Fig 3: what is A B C? 
\R%-------------------------------------------------------------------------------
%[JR]
The legend was completed.

\Q%###############################################################################
Fig 9 \& 11: define the box plot intervals and the meaning of the circles 
\R%-------------------------------------------------------------------------------
%[JR] Donne légende complétée en citant Tuckey qui a inventé cette représentation : drawn according to \cite{Tukey1976} with points more than 1.5$\times$IQR from the 1\textsuperscript{st} and 3\textsuperscript{rd} quartiles considered as outliers (circles).
The legends were completed.

\Q%###############################################################################

\end{document}
